package com.xxl.api.admin.dao.impl;

import com.xxl.api.admin.core.model.XxlApiParameterType;
import com.xxl.api.admin.dao.XxlApiParameterTypeDao;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/5/18.
 */
@Repository
public class XxlApiParameterTypeDaoImpl implements XxlApiParameterTypeDao {

    @Resource
    public SqlSessionTemplate sqlSessionTemplate;

    @Override
    public List<XxlApiParameterType> selectAll() {
        return sqlSessionTemplate.selectList("XxlApiParameterTypeMapper.selectAll");
    }

    @Override
    public int add(XxlApiParameterType xxlApiParameterType) {
        return sqlSessionTemplate.insert("XxlApiParameterTypeMapper.add",xxlApiParameterType);
    }

    @Override
    public XxlApiParameterType selectByType(String type) {
        return sqlSessionTemplate.selectOne("XxlApiParameterTypeMapper.selectByType",type);
    }
}
